<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<script type="text/javascript" src="${base}/scripts/util.js"></script>
<script type="text/javascript" src="${base}/dwr/engine.js"></script>
<script type="text/javascript" src="${base}/dwr/interface/dictionarysan.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>lightTreeview - jQuery树型菜单插件</title>
<link href="${base}/scripts/jquerytree/jquery.lightTreeview.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/scripts/jquerytree/jquery.lightTreeview.pack.js"></script>
<script type="text/javascript">
$(function() {
	$('#demo3').lightTreeview({
		collapse: true,
		line: true,
		nodeEvent: true,
		unique: true,
		style: 'black',
		animate: 400
	});
		var $self = $(".treeview-folder");
		$self.click(function(){
			$self.removeClass("tree");
			$(".treeview-file").removeClass("tree");
			$(this).addClass("tree");
			dictionarysan.get(this.id,callback);
			$("#insert").removeClass("treeButton");
		});
		
		$(".treeview-file").click(function(){
			$self.removeClass("tree");
			$(".treeview-file").removeClass("tree");
			$(this).addClass("tree");
			dictionarysan.get(this.id,callback);
			$("#insert").addClass("treeButton");
		});
			$("#insert").click(function(){
				$("#dictionaryParentId").val($("#dictionaryId").val());
				$("#dictionaryId").val('');
				$("#dictionaryVersion").val('');
			})
});
</script>
<style type="text/css">
body {
	font-size: 12px;
	font-family: "宋体";
}
pre {
	font-family: Courier New;
	font-size: 14px;
	border:#CCCCCC 1px solid;
	padding:3px;
	background-color: #E0FBFA;
}
p {
	line-height: 150%;
	margin: 0;
}
.btn {
	cursor: pointer;
	color: #0066FF;
}
.exp {
	font-family: "Courier New","宋体";
	font-size: 12px;
	color: gray;
}
.tree{color:red;}
.treeButton{display:none;}
</style>
<script>
	function callback(n){
			$("#dictionaryId").val(n.id);
			$("#dictionaryVersion").val(n.version);
			$("#dictionaryName").val(n.name);
			$("#dictionaryDescription").val(n.description);
			$("#dictionarySort").val(n.sort);
			$("#dictionaryParentId").val(n.parentId);
	}
</script>
</head>

<body>
<table><tr><td width="50%">
<h2>字典表维护</h2>
<ul id="demo3" class="lightTreeview treeview-black">
	<li>
		<div class="treeview-folder" id="${dictionary.id?default('')}">${dictionary.name?default('')}</div>
		<ol>
		<#if dictionary.son??>
			 <#list dictionary.son?sort_by("sort") as son>
				 <li>
					<div class="treeview-folder" id="${son.id?default('')}">${son.name?default('')}</div>
					<ul style="display:none">
						<#if son.son??>
			 				<#list son.son?sort_by("sort") as grandson>
								<li><div class="treeview-file" id="${grandson.id?default('')}">${grandson.name?default('')}</div></li>
							 </#list>
						</#if>
					</ul>
				</li>
			 </#list>
		</#if>
		</ol>
	</li>
</ul>
</td>
<td id="xpnetdiagInfo" align="left" colspan="1" width="400" bordercolor="#00FF00" style="border-style:solid; border-width:2px; padding-left: 0px; padding-right: 8px; padding-top: 8px; padding-bottom: 8px">
<div>
<form name="dictionaryForm" id="dictionaryForm" method="post" action="${base}/dictionary/dictionary/save.shtml">
<input type="hidden" name="dictionary.id" id="dictionaryId" value="${dictionary.id?default('')}" />
<input type="hidden" name="dictionary.version" id="dictionaryVersion" value="${dictionary.version?default('')}" />
<input type="hidden" name="dictionary.parentId" id="dictionaryParentId" value="${dictionary.parentId?default('')}" />
  <table  border="0" align="center"  cellpadding="3" cellspacing="1">
    <tr>
      <td align="left">标题*</td>
      <td ><input name="dictionary.name" id="dictionaryName" value="${dictionary.name?default('')}" type="text" size="30" style="border:1px dashed  #b60000; height:22px; "/>&nbsp;</td>
    </tr>
    <tr>
      <td align="left">描述*</td>
      <td ><input name="dictionary.description" id="dictionaryDescription" value="${dictionary.description?default('')}" type="text" size="30" style="border:1px dashed  #b60000; height:22px; "/>&nbsp;</td>
    </tr>
    <tr>
      <td align="left">顺序*</td>
      <td ><input name="dictionary.sort" id="dictionarySort" value="${dictionary.sort?default('')}" type="text" size="6" style="border:1px dashed  #b60000; height:22px; "/>&nbsp;
      <input type="submit" name="button" id="update" value="修改" />
      <input type="submit" name="button" id="insert" value="增加" />
      </td>
    </tr>
  </table>
   
    </form>


<div>
</td></tr>
</table>


</body>

</html>
